dotConnect for MySQL Documentation
Devart.Data.MySql Namespace / MySqlBlob Class / MySqlBlob Constructor / MySqlBlob Constructor(Byte[])
The byte array to be stored in the Value property.
Example

In This Topic
    MySqlBlob Constructor(Byte[])
    In This Topic
    Initializes a new instance of the MySqlBlob class, setting the Value property to the provided array of bytes.
    Syntax
    'Declaration
     
    Public Function New( _
       ByVal value() As Byte _
    )
    public MySqlBlob( 
       byte[] value
    )

    Parameters

    value
    The byte array to be stored in the Value property.
    Example
    In the following example a byte array is initialized and passed as parameter to MySqlBlob constructor. Afterwards the data is read from the instance of MySqlBlob.
    public void ConstructMyBlob()
    {
      byte[] myByteArray = {1,2,3,4,5,6,7,8,9,10};
      MySqlBlob myBlob = new MySqlBlob(myByteArray);
      myBlob.Seek(0,SeekOrigin.Begin);
      for (int i = 0; i<10;i++)
      {
        Console.WriteLine(myBlob.ReadByte());
      }
    }
    Public Sub ConstructMyBlob()
      Dim myByteArray() As Byte = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
      Dim myBlob As MySqlBlob = New MySqlBlob(myByteArray)
      myBlob.Seek(0, SeekOrigin.Begin)
      Dim i As Integer
      For i = 0 To 9
        Console.WriteLine(myBlob.ReadByte())
      Next i
    End Sub
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also